Skip to content

Conversation

pvital
Copy link
Member

@pvital pvital commented Jul 24, 2025

This PR:

  1. Format the TheMachine and Discovery classes by adding type annotations to the fsm.py file and using ruff.
  2. Refactor the Discovery class by changing it to a DataClass, and move it out of the fsm.py file.
  3. Add support to announce Windows processes. The implementation gracefully handles platform differences, ensuring consistent process information on both Unix and Windows environments:
  • Created a new _get_cmdline() function to return the command line of the current monitored process independently of the running platform.
  • Created the _get_cmdline_windows() function to return the command line on Windows machines.
  • Created _get_cmdline_unix() that returns the command line in Unix machines. It decides how to collect the information by running either the _get_cmdline_linux_proc() or the _get_cmdline_unix_ps().
  • Refactored the _setup_socket_connection() function.

Signed-off-by: Paulo Vital [email protected]

@pvital pvital self-assigned this Jul 24, 2025
@pvital pvital force-pushed the fix_announce_on_windows branch from 1c46822 to 6210833 Compare August 8, 2025 15:13
pvital added 3 commits August 27, 2025 10:28
Added type annotations to the fsm.py file and used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <[email protected]>
And move it out of the fsm.py file.

Signed-off-by: Paulo Vital <[email protected]>
This commit adds cross-platform process announcement to Instana Host Agents.

The implementation gracefully handles platform differences, ensuring consistent process information on both Unix and Windows environments:

- Created a new `_get_cmdline()` function to return the command line of the current monitored process independently of the running platform.
- Created the `_get_cmdline_windows()` function to return the command line on Windows machines.
- Created `_get_cmdline_unix()` that returns the command line in Unix machines. It decides how to collect the information by running either the ` _get_cmdline_linux_proc()` or the `_get_cmdline_unix_ps()`.
- Refactored the `_setup_socket_connection()` function.

Signed-off-by: Paulo Vital <[email protected]>
@pvital pvital force-pushed the fix_announce_on_windows branch from 6210833 to cc83566 Compare August 27, 2025 22:03
@pvital pvital marked this pull request as ready for review August 27, 2025 22:08
@pvital pvital requested a review from a team as a code owner August 27, 2025 22:08
Copy link
Contributor

@GSVarsha GSVarsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pvital pvital merged commit 1da36f4 into main Aug 28, 2025
18 checks passed
@pvital pvital deleted the fix_announce_on_windows branch August 28, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants